home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / game / shoot / ADoom_src_1_2.lha / ADoom_src / amiga_data.s < prev    next >
Text File  |  1998-02-28  |  2KB  |  90 lines

  1.         mc68020
  2.  
  3.         xdef    @R_GetColumn
  4.         xdef    _R_GetColumn
  5.  
  6.         section    text,code
  7.  
  8.         near    a4,-2
  9.  
  10. ;-----------------------------------------------------------------------
  11. ; R_GetColumn (in r_data.c) by Arto Huusko <arto.huusko@pp.qnet.fi>
  12.  
  13.         xref    @W_CacheLumpNum
  14.         xref    @R_GenerateComposite
  15.         xref    _texturewidthmask    ; byte*
  16.         xref    _texturecolumnlump    ; short**
  17.         xref    _texturecolumnofs    ; unsigned short**
  18.         xref    _texturecomposite    ; byte**
  19.  
  20. ;int*            texturewidthmask;
  21. ;fixed_t*        textureheight;        
  22. ;int*            texturecompositesize;
  23. ;short**        texturecolumnlump;
  24. ;unsigned short**    texturecolumnofs;
  25. ;byte**            texturecomposite;
  26.  
  27.         cnop    0,4
  28. @R_GetColumn:
  29. _R_GetColumn:
  30.         movem.l    d2/d4,-(sp)
  31.  
  32.         move.l    _texturewidthmask(a4),a0
  33.         and.l    (a0,d0.l*4),d1    ; col &= texturewidthmask[tex]
  34.         move.l    d0,d2        ; Save the value of tex
  35.  
  36.         move.l    _texturecolumnofs(a4),a0
  37.         move.l    (a0,d2.l*4),a0
  38.         moveq    #0,d4
  39.         move.w    (a0,d1.l*2),d4
  40.         move.l    _texturecolumnlump(a4),a0
  41.         move.l    (a0,d2.l*4),a0
  42.         moveq    #0,d0
  43.         move.w    (a0,d1.l*2),d0
  44.         ble.b    .rg_1        ; if lump >0
  45.  
  46.         moveq    #101,d1        ; PU_CACHE
  47.         jsr    (@W_CacheLumpNum)
  48.         add.l    d4,d0
  49.         movem.l    (sp)+,d2/d4
  50.         rts
  51.  
  52.         cnop    0,4
  53. .rg_1:
  54.         move.l    _texturecomposite(a4),a0
  55.         move.l    (a0,d2.l*4),d0
  56.         bne.b    .rg_NotNull
  57.         move.l    d2,d0
  58.         jsr    (@R_GenerateComposite)
  59.         move.l    _texturecomposite(a4),a0
  60.         move.l    (a0,d2.l*4),d0
  61. .rg_NotNull:
  62.         add.l    d4,d0
  63.         movem.l    (sp)+,d2/d4
  64.         rts
  65.  
  66. ;byte*
  67. ;R_GetColumn
  68. ;( int        tex,
  69. ;  int        col )
  70. ;{
  71. ;    int        lump;
  72. ;    int        ofs;
  73. ;    
  74. ;    col &= texturewidthmask[tex];
  75. ;    lump = texturecolumnlump[tex][col];
  76. ;    ofs = texturecolumnofs[tex][col];
  77. ;
  78. ;    if (lump > 0)
  79. ;    return (byte *)W_CacheLumpNum(lump,PU_CACHE)+ofs;
  80. ;
  81. ;   if (!texturecomposite[tex])
  82. ;    R_GenerateComposite (tex);
  83. ;
  84. ;   return texturecomposite[tex] + ofs;
  85. ;}
  86.  
  87. ;-----------------------------------------------------------------------
  88.  
  89.         end
  90.